﻿<%@ Page Title="+Curso - Home" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="S2B_SCL._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Seja Bem Vindo ao +Curso
    </h2>
    <p><h3>Aqui você terá todas as informações que possam ajudá-lo a se destacar no mercado de trabalho!</h3></p>
    
    <asp:Label ID="lblDefaultArea" runat="server" Text="Área do Curso:"></asp:Label>
&nbsp;<asp:DropDownList ID="DropDownList1" runat="server" 
        DataSourceID="SqlDataSource2" DataTextField="Area" DataValueField="Area">
    </asp:DropDownList>
    &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="lblDefaultEstado" runat="server" Text="Estado:"></asp:Label>
    <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource1" 
            DataTextField="NomeEstado" DataValueField="NomeEstado">
        </asp:DropDownList>
        &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label1" runat="server" Text="Valor:"></asp:Label>
    <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="SqlDataSource3" 
            DataTextField="PagoGratis" DataValueField="PagoGratis">
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT * FROM [TBPagoGratis] ORDER BY [PagoGratis]">
        </asp:SqlDataSource>
        &nbsp;<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT * FROM [TBEstado] ORDER BY [NomeEstado]">
        </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT [Area] FROM [TBArea] ORDER BY [Area]">
    </asp:SqlDataSource>
        <asp:Button ID="Button1" runat="server" Text="Pesquisar" BorderColor="#FF9900" 
            BorderStyle="Outset" onclick="Button1_Click" />
    
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource4">
        <Columns>
            <asp:BoundField DataField="NomeCurso" HeaderText="NomeCurso" 
                SortExpression="NomeCurso" />
            <asp:BoundField DataField="IDPagoGratis" HeaderText="IDPagoGratis" 
                SortExpression="IDPagoGratis" />
            <asp:BoundField DataField="IDArea" HeaderText="IDArea" 
                SortExpression="IDArea" />
            <asp:BoundField DataField="LinkCurso" HeaderText="LinkCurso" 
                SortExpression="LinkCurso" />
            <asp:BoundField DataField="DuracaoHoras" HeaderText="DuracaoHoras" 
                SortExpression="DuracaoHoras" />
            <asp:BoundField DataField="IDEmpresa" HeaderText="IDEmpresa" 
                SortExpression="IDEmpresa" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="select TBCurso.NomeCurso,TBCurso.IDPagoGratis,TBCurso.IDArea,TBCurso.LinkCurso,TBCurso.DuracaoHoras,TBCurso.IDEmpresa from TBCurso inner join TBArea on TBCurso.IDArea=TBArea.IDArea inner join TBEstado on TBCurso.IDEstado=TBEstado.IDEstado inner join TBEmpresa on TBEmpresa.IDEmpresa=TBCurso.IDEmpresa where TBCurso.IDArea=3 and TBEstado.NomeEstado='São Paulo' and TBCurso.IDPagoGratis=2;

"></asp:SqlDataSource>
    <br />
    <br />
    
    <p>
        &nbsp;</p>
    <p>
        &nbsp;</p>
    </asp:Content>
